#ifndef _state_vector_h_
#define _state_vector_h_

#include <stdio.h>

#define CELL_EMPTY    1
#define CELL_FULL     2
#define CELL_BOUNDARY 4 

typedef struct {
  int *type;
  double *vr;
  double *vt;
  double *vz;
  double *p;
} sv_t;

sv_t *sv_alloc(); 

void sv_free(sv_t *sv); 

sv_t *sv_dup(sv_t *sv);  

void sv_axpby(sv_t *z, double alpha, sv_t *x, double beta, sv_t *y);

void sv_fwrite(sv_t *y, FILE *fp);

void sv_fread(sv_t *y, FILE *fp);

int sv_get_type(sv_t *y, int i, int j, int k);

double sv_get_vr(sv_t *y, int i, int j, int k);

double sv_get_vt(sv_t *y, int i, int j, int k);

double sv_get_vz(sv_t *y, int i, int j, int k);

void sv_set_vr(sv_t *z, int i, int j, int k, double value);

void sv_set_vt(sv_t *z, int i, int j, int k, double value);

void sv_set_vz(sv_t *z, int i, int j, int k, double value);

#endif

